from core.room import Room
from core.basehandler import BaseHandler

from core.basehandler import BaseHandler
from core.room import Room
from items.test import test
from items.test2 import test2
from core.action import Action
from core.support import get_game

class VictoryRoom(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
    
    # return description of room.
    def get_description(self):
        game = get_game()
        player = game.get_player()
        score = len(player.inventory)
        
        message= ''
        
        if score > 8: 
            message = 'Congratulations, you graduate with high honors! Your successes will eclipse Steve Jobs and Jeff Bezos!'
        elif score > 6:
            message = 'Congratulations, you made it! Your successes will eclipse Enron and WorldCom!'
        elif score > 4:
            message = 'Phew, you barely made it! Now get ready to flip some burgers!'
        else:
            message = 'WAIT, GO BACK! You don\'t have enough credits to graduate!'
        
        
        return message
                
        '''
        You collect the treasure and exit from the house.  You have won the game!  Congratulations!
         '''
    
    # return image of room
    def get_image(self):
        game = get_game()
        player = game.get_player()
        score = len(player.inventory)
        
        if score > 8: 
            return 'graduate_2.jpg'
        elif score > 6:
            return 'graduate.jpg'
        elif score > 4:
            return 'flipping-burgers-300x199 (1).jpg'
        else:
            return 'no_graduation.jpg'


class VictoryRoomHandler(BaseHandler):
    
    # override default template to omit the inventory and actions
    def get_template(self):
        return 'victory.html'
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return VictoryRoom

# define actions for this room
